Skip to content

fix(virtual-core): add 'instant' to ScrollBehavior type#1122

Merged
piecyk merged 3 commits intoTanStack:mainfrom
muraliavarma:fix/scroll-behavior-instant-type
Mar 6, 2026
Merged

fix(virtual-core): add 'instant' to ScrollBehavior type#1122
piecyk merged 3 commits intoTanStack:mainfrom
muraliavarma:fix/scroll-behavior-instant-type

Conversation

@muraliavarma
Copy link
Contributor

🎯 Changes

Add 'instant' to the ScrollBehavior type in virtual-core.

The W3C spec defines ScrollBehavior as "auto" | "smooth" | "instant", and all modern browsers support it. The library's custom type only included "auto" | "smooth", causing a TypeScript error when using behavior: 'instant' with scrollToIndex / scrollToOffset.

Closes #1074

✅ Checklist

  • I have followed the steps in the Contributing guide.
  • I have tested this code locally with pnpm run test:pr.

🚀 Release Impact

  • This change affects published code, and I have generated a changeset.
  • This change is docs/CI/dev-only (no release).

The W3C spec and all modern browsers support 'instant' as a valid
ScrollBehavior value, but the type only allowed 'auto' | 'smooth'.

Closes TanStack#1074
@changeset-bot
Copy link

changeset-bot bot commented Feb 10, 2026

🦋 Changeset detected

Latest commit: 0f7662c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@tanstack/virtual-core Patch
@tanstack/angular-virtual Patch
@tanstack/lit-virtual Patch
@tanstack/react-virtual Patch
@tanstack/solid-virtual Patch
@tanstack/svelte-virtual Patch
@tanstack/vue-virtual Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@nx-cloud
Copy link

nx-cloud bot commented Mar 6, 2026

View your CI Pipeline Execution ↗ for commit 0f7662c

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ✅ Succeeded 2m 6s View ↗
nx run-many --target=build --exclude=examples/** ✅ Succeeded 17s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-06 11:43:27 UTC

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 6, 2026

More templates

@tanstack/angular-virtual

npm i https://pkg.pr.new/@tanstack/angular-virtual@1122

@tanstack/lit-virtual

npm i https://pkg.pr.new/@tanstack/lit-virtual@1122

@tanstack/react-virtual

npm i https://pkg.pr.new/@tanstack/react-virtual@1122

@tanstack/solid-virtual

npm i https://pkg.pr.new/@tanstack/solid-virtual@1122

@tanstack/svelte-virtual

npm i https://pkg.pr.new/@tanstack/svelte-virtual@1122

@tanstack/virtual-core

npm i https://pkg.pr.new/@tanstack/virtual-core@1122

@tanstack/vue-virtual

npm i https://pkg.pr.new/@tanstack/vue-virtual@1122

commit: 7a481c1

@piecyk piecyk merged commit 54d771a into TanStack:main Mar 6, 2026
4 checks passed
@github-actions github-actions bot mentioned this pull request Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript types for scrollToIndex behavior missing 'instant' option

2 participants